$('.submit_wu').on('click', function() {
	getVal_wu();
});
$('.submit_yi').on('click', function() {
	getVal_yi();
});
$('.submit_yu').on('click', function() {
	getVal_yu();
});
var url_ = window.location.href;

function getVal_wu() {
	var user_name = $(".user_name").val();
	var mobile_Val = $(".mobile_Val").val();
	var wx_msg = $(".wx_msg").val();
	var leave_msg = $(".leave_msg").val();
	var regName = /^[ \u4e00-\u9fa5A-Za-z]+$/;
	var regTel = /^1[3-8]\d{9}$/;
	var xm = "悟茶_wap";
	if(!regName.test(user_name)) {
		layer.msg('输入名字不合法', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(!regTel.test(mobile_Val)) {
		layer.msg('请输入正确手机号', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(wx_msg == "") {
		layer.msg('微信不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(leave_msg == "") {
		layer.msg('留言不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	$.ajax({
		type: "get",
		url: "http://wl.xiyuankj.com/index.php/Home/Public/addGo",
		dataType: "jsonp",
		data: {
			url: url_,
			username: user_name,
			xm: xm,
			tel: mobile_Val,
			qq: wx_msg,
			con: leave_msg
		},
		jsonp: "callback",
		success: function(res) {
			console.log(res.status);
			if(res['status'] == 1) {
				alert("提交成功");
				setTimeout(function() {
					location.reload();
				}, 1000)
			};
		},
		error: function(res) {
			alert("提交失败");
		}
	});
}

function getVal_yi() {
	var user_name = $(".user_name").val();
	var mobile_Val = $(".mobile_Val").val();
	var wx_msg = $(".wx_msg").val();
	var leave_msg = $(".leave_msg").val();
	var regName = /^[ \u4e00-\u9fa5A-Za-z]+$/;
	var regTel = /^1[3-8]\d{9}$/;
	var xm = "一夫茶_wap";
	if(!regName.test(user_name)) {
		layer.msg('输入名字不合法', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(!regTel.test(mobile_Val)) {
		layer.msg('请输入正确手机号', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(wx_msg == "") {
		layer.msg('微信不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(leave_msg == "") {
		layer.msg('留言不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	$.ajax({
		type: "get",
		url: "http://yjr.xiyuankj.com/index.php/Home/Public/addGo",
		dataType: "jsonp",
		data: {
			url: url_,
			username: user_name,
			xm: xm,
			tel: mobile_Val,
			qq: wx_msg,
			con: leave_msg
		},
		jsonp: "callback",
		success: function(res) {
			console.log(res);
			if(res['status'] == 1) {
				alert("提交成功");
				setTimeout(function() {
					location.reload();
				}, 1000)
			};
		},
		error: function(res) {
			alert("提交失败");
		}
	});
}

function getVal_yu() {
	var user_name = $(".user_name").val();
	var mobile_Val = $(".mobile_Val").val();
	var wx_msg = $(".wx_msg").val();
	var leave_msg = $(".leave_msg").val();
	var regName = /^[ \u4e00-\u9fa5A-Za-z]+$/;
	var regTel = /^1[3-8]\d{9}$/;
	var xm = "御茶_wap";
	if(!regName.test(user_name)) {
		layer.msg('输入名字不合法', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(!regTel.test(mobile_Val)) {
		layer.msg('请输入正确手机号', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(wx_msg == "") {
		layer.msg('微信不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	if(leave_msg == "") {
		layer.msg('留言不能为空', {
			icon: 2,
			time: 1500
		});
		return false;
	}
	$.ajax({
		type: "get",
		url: "http://ds.xiyuankj.com/index.php/Home/Public/addGo",
		data: {
			url: url_,
			username: user_name,
			xm: xm,
			tel: mobile_Val,
			qq: wx_msg,
			con: leave_msg
		},
		dataType: "jsonp",
		jsonp: "callback",
		success: function(res) {
			console.log(res.status);
			if(res['status'] == 1) {
				alert("提交成功");
				setTimeout(function() {
					location.reload();
				}, 1000)
			};
		},
		error: function(res) {
			alert("提交失败");
		}
	});
}